using UnityEngine;
using System.Collections;

[System.Serializable]
public class CrouchAnimation : MonoBehaviour {
	
	public string crouchAnimation;
	public string getUpAnimation;
	public string crouchedAnimation;
	
	private bool crouched = false;
	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		if (Input.GetKey("c")) {
			if (!crouched) {
				this.animation.Play(crouchAnimation);
				crouched = true;
			} else {
				this.animation.Play(crouchedAnimation);
			}
		} else {
			this.animation.Play(getUpAnimation);
			crouched = false;
		}
	}
}
